#include "iostream"
#include <string>
using namespace std;
char map[21][21];
int change[4][2] = { {0,1},{0,-1},{1,0},{-1,0} };
struct note
{
	int x;
	int y;
}q[406];
int head = 0, tail = 0;

int better = -1, bx, by;

void calc(int x, int y)
{
	int cnt=0;
	for (int t = 0; t < 4; t++)
	{
		int nx = x, ny = y;
		while (map[nx][ny] != '#')
		{
			nx = nx + change[t][0];
			ny = ny + change[t][1];
			if (map[nx][ny] == 'G')
				cnt++;
		}
	}
	if (cnt > better)
	{
		better = cnt;
		bx = x;
		by = y;
	}
}

int main()
{
	int n, m,sx,sy;
	cin >> n >> m>>sx>>sy;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			cin >> map[i][j];
		}
	}

	q[tail].x = sx;
	q[tail].y = sy;
	map[sx][sy] = 'b';	//book
	tail++;
	while (head < tail)
	{
		for (int t = 0; t < 4; t++)
		{
			int nx = q[head].x+change[t][0];
			int ny = q[head].y + change[t][1];
			if (nx >= 0 && nx < n&&ny >= 0 && ny < m&&map[nx][ny] == '.')
			{
				q[tail].x = nx;
				q[tail].y = ny;
				tail++;
				map[nx][ny] = 'b';
				calc(nx, ny);
			}
		}
		head++;
	}
	cout << better << endl;
	cout << bx << by << endl;
	return 0;
}

/*
13 13 3 1
#############
#GG.GGG#GGG.#
###.#G#G#G#G#
#.......#..G#
#G#.###.#G#G#
#GG.GGG.#.GG#
#G#.#G#.#.###
##G...G.....#
#G#.#G###.#G#
#...G#GGG.GG#
#G#.#G#G#.#G#
#GG.GGG#G.GG#
#############
*/